home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / NDK / NDK_3.5 / Tutorials / ARexx / FunctionLibrary / test.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1997-01-27  |  771 b   |  26 lines

  1. /* Has rexxsample.library already been made
  2.  * available to ARexx? If not, add it with the
  3.  * "addlib" built-in function. This function takes
  4.  * Three parameters: priority, offset and version.
  5.  * The priority determines the order in which ARexx
  6.  * will ask the library dispatchers if they can handle
  7.  * a certain command. The offset value gives the
  8.  * function offset of the library dispatcher to call.
  9.  * The version specifies which library version to open.
  10.  */
  11.  
  12. if ~show(l, "rexxsample.library") then do
  13.     if ~addlib("rexxsample.library", 0, -30, 0) then do
  14.         say "Could not add rexxsample.library."
  15.         exit(20)
  16.     end
  17. end
  18.  
  19.     /* Invoke the "ADD" function. */
  20.  
  21. say "ADD(17,31) =" add(17,31)
  22.  
  23.     /* Invoke the "DIV" function with a zero divisor. */
  24.  
  25. say "DIV(42,0) =" div(42,0)
  26.